/**
 * @file sleep.h
 *
 */
#ifndef SLEEP_H
#define SLEEP_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_SLEEP != 0

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 * GLOBAL PROTOTYPES
 **********************/
typedef struct
{
    int32_t longsleep_start_min;   //minutes [0,59]
    int32_t longsleep_start_hour;  //hour [0,23]
    int32_t longsleep_end_min;     //minutes [0,59]
    int32_t longsleep_end_hour;    //hour [0,23]
    int32_t longsleep_sum_min;
    int32_t shortsleep_sum_min;
} app_adptor_sleep_get_time_req;

typedef struct
{
    lv_watch_activity_ext_t activity_obj;

    /*New data for this type */
    app_adptor_sleep_get_time_req *time;
} lv_sleep_obj_ext_t;

typedef struct
{
    lv_tileview_ext_t old_ext;

} lv_sleep_drop_pull_obj_ext_t;

#if USE_LV_WATCH_LAUNCHER2 != 0
typedef struct
{
    lv_cont_ext_t cont_ext;
    app_adptor_sleep_get_time_req * time;
}lv_launcher_sleep_tab_ext;     
void sleep_create_tab(lv_obj_t * par);
void sleep_destroy_tab(lv_obj_t * par);
#endif

lv_sleep_obj_ext_t * sleep_get_ext(void);
lv_obj_t * sleep_tileview_add_tile(lv_obj_t * tileview, uint16_t id);
lv_obj_t * sleep_info_create(lv_obj_t * tileview, uint16_t id);
uint32_t sleep_get_time_req(app_adptor_sleep_get_time_req *time);
void sleep_create_event_cb(lv_obj_t * btn, lv_event_t e);
/**********************
 *      MACROS
 **********************/


#endif /*USE_LV_WATCH_SLEEP*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*SLEEP_H*/
